import fly from '@/utils/request.js'

export const requestPost = (url, data = {}) => {
  return new Promise((resolve, reject) => {
    fly.post(url, data).then((res) => {
      resolve(res.data)
    }).catch((error) => reject(error))
  })
}

export const requestGet = (url, data = {}) => {
  return new Promise((resolve, reject) => {
    fly.get(url, data).then((res) => {
      resolve(res.data)
    }).catch((error) => reject(error))
  })
}